/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sax;

import dto.Category;
import java.util.ArrayList;
import java.util.List;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

/**
 *
 * @author duonghung1369
 */
public class SAXCategoryHandler extends DefaultHandler{
    private List<Category> categories;

    public SAXCategoryHandler() {
        categories = new ArrayList<Category>();
    }

    public SAXCategoryHandler(List<Category> categories) {
        this.categories = categories;
    }

    @Override
    public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
        super.startElement(uri, localName, qName, attributes);
    }

    @Override
    public void characters(char[] ch, int start, int length) throws SAXException {
        super.characters(ch, start, length);
    }

    @Override
    public void endElement(String uri, String localName, String qName) throws SAXException {
        super.endElement(uri, localName, qName);
    }

    public List<Category> getCategories() {
        return categories;
    }

    
}
